package com.phkj.qdh.ui.adapter.employeenode

import com.phkj.qdh.bean.DeptTreeVoList
import com.phkj.qdh.bean.DeptUserVo
import com.phkj.qdh.utils.node.BaseExpandNode
import com.phkj.qdh.utils.node.BaseNode
import com.phkj.qdh.utils.node.BaseNodeAdapter

class EmployeeNodeAdapter: BaseNodeAdapter() {
   init {
       addNodeProvider(EmployeeHeadProvider())
       addNodeProvider(EmployeeContentProvider())
   }
    override fun getItemType(data: List<BaseNode>, position: Int): Int {
        when(data[position]){
            is EmployeeHeadNode->{
                return 1
            }
            else ->{
                return 2
            }
        }
    }
}


class EmployeeHeadNode(
    val tree: DeptTreeVoList, val child: MutableList<BaseNode>
) : BaseExpandNode() {

    init {
        isExpanded = true
    }
    override val childNode: MutableList<BaseNode>?
        get() = child
}

class EmployeeNode(
    val tree: DeptUserVo,
    var isSelected:Boolean = false
) : BaseExpandNode() {
    init {
        isExpanded = true
    }
    override val childNode: MutableList<BaseNode>?
        get() = null
}
